package com.shangbang.verb;


import org.apache.commons.lang3.StringUtils;

public interface CommEnum {

	//公共删除枚举类
	public enum DELETE_FLAG implements CommEnum{
		DELETE("删除",1), KEEP("不删除",0);

		/**
		 * 描述
		 */
		private String desc;
		/**
		 * 值
		 */
		private int value;

		private DELETE_FLAG(String desc, int value) {
			this.desc = desc;
			this.value = value;
		}

		public String getDesc() {
			return desc;
		}

		public void setDesc(String desc) {
			this.desc = desc;
		}

		public int getValue() {
			return value;
		}

		public void setValue(int value) {
			this.value = value;
		}
	}
	public enum FOLDER implements CommEnum{
		CAROUSEL_FOLDER("carousel", "carouselImages/"),
		TASK_FOLDER("task","taskImages/");


		private String name;
		private String path;
		// 构造方法
		private FOLDER(String name, String path) {
			this.name = name;
			this.path = path;

		}

		//获取路径
		public static String getPath(String name) {
			if(StringUtils.isNotEmpty(name)){
				for (FOLDER folder : FOLDER.values()) {
					if (folder.getName().equals(name)) {
						return folder.path;
					}
				}
			}
			return null;
		}


		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public String getPath() {
			return path;
		}

		public void setPath(String path) {
			this.path = path;
		}
	}




}
